{include file="index/_meta" /}
    <title>我的</title>
<style>
    .topDiv {
        background: url("/static/wechat/img/user/me_top.jpg") no-repeat;
        background-size: 100% 100%;
        height: 15rem;
    }
    .dataDiv{
        padding: 16px 0;
        background: #fff;
    }
    .dataDiv p{
        text-align: center;
        margin: 0;
        color: #8F95A0;
    }
    .dataDiv p b{
        font-size: 1.5rem;
    }
    .dataDiv .van-hairline--right::after {
        top: -30%;
        bottom: -30%;
        border: 0 solid #9A9A9A;
        border-right-width: 2px;
    }
</style>
</head>
<body>
<div id="app">

    <van-pull-refresh v-model="isLoading" @refresh="onRefresh" style="margin-bottom:50px;">

        <div class="topDiv">
            <div class="topInfo">
                <van-row>
                    <van-col span="24" style="text-align: center;padding-top: 3rem;">
                        <van-image
                                width="5rem"
                                height="5rem"
                                round
                                fit="cover"
                                :src="userInfo.headimgurl"
                        ></van-image>
                        <p style="margin-top: .2rem;color: #fff;">{{userInfo.nickname}}</p>
                        <van-icon name="shop-collect" size="1.5rem" color="#fff"
                                  style="position: absolute;top: 10px;right: 10px;"
                                  @click="jumpStore"></van-icon>
                    </van-col>
                </van-row>
            </div>
        </div>

        <div class="dataDiv">
            <van-row>
                <van-col span="8" class="van-hairline--right" @click="jumpOrder">
                    <p><b style="color: #35C0FE;">{{userInfo.order_num}}</b>&nbsp;个</p>
                    <p>个人订单</p>
                </van-col>
                <van-col span="8" class="van-hairline--right" @click="jumpCash">
                    <p><b style="color: #F75C5F;">{{userInfo.money}}</b>&nbsp;元</p>
                    <p>我的余额</p>
                </van-col>
                <van-col span="8" class="van-hairline--right" @click="$router.push({path:'/user/share/lst'})">
                    <p><b style="color: #35C0FE;">{{userInfo.share_order_num}}</b>&nbsp;个</p>
                    <p>分享订单</p>
                </van-col>
            </van-row>
        </div>

        <div style="margin-top:1em;">

            <div style="margin-bottom: 15px;">
                <van-cell title="我的订单" is-link @click="jumpOrder"></van-cell>
                <van-cell title="收货地址" is-link @click="jumpAddress"></van-cell>
                <van-cell title="我的分享" is-link @click="jumpShare"></van-cell>
                <van-cell title="去提现" :value="userInfo.money" @click="jumpCash"></van-cell>
                <van-cell title="我的发布" is-link @click="jumpForum"></van-cell>
                <van-cell title="客服中心" is-link @click="jumpCustomer"></van-cell>
            </div>

            <div style="margin-bottom: 15px;" v-if="userInfo.shop_id > 0">
                <van-cell-group title="商家服务">
                    <van-cell title="核销订单" is-link @click="jumpStore"></van-cell>
                    <van-cell title="商品管理" is-link @click="jumpStoreGoods"></van-cell>
                    <van-cell title="订单管理" is-link @click="jumpStoreOrder"></van-cell>
                    <van-cell title="资料管理" is-link @click="jumpStoreInfo"></van-cell>
                </van-cell-group>
            </div>

        </div>

    </van-pull-refresh>
    {include file="index/_tabbar" /}
</div>
<script>
    new Vue({
        el: "#app",
        data(){return{
            active:3,
            userInfo:{},
            yes: true,
            no: false,
            isLoading: false,
        }},
        created(){
            this.getUserInfo()
        },
        methods:{
            onTabbarChange(index){
                let url = '';
                switch (index) {
                    case 0:url = "{:url('index/index')}";break;
                    case 1:url = "{:url('shop/index')}";break;
                    case 2:url = "{:url('forum/index')}";break;
                    case 3:url = "{:url('user/index')}";break;
                }
                window.location.href = url;
            },
            // 上拉刷新
            onRefresh() {
                this.isLoading = false
            },
            getUserInfo(){
                let that = this
                axios.post("{:url('user/getUser')}").then(function (ret) {
                    that.userInfo = ret.data.data
                })
            },
            jumpCustomer(){
              window.location.href = "{:url('user/customer')}"
            },
            jumpOrder(){
              window.location.href = "{:url('user/order_list')}"
            },
            jumpAddress(){
              window.location.href = "{:url('user/address_index')}"
            },
            jumpShare(){
              window.location.href = "{:url('user/share')}"
            },
            jumpCash(){
              window.location.href = "{:url('user/cash_index')}"
            },
            jumpStore(){
              window.location.href = "{:url('store/index')}"
            },
            jumpStoreGoods(){
              window.location.href = "{:url('store/goods_index')}"
            },
            jumpStoreOrder(){
                window.location.href = "{:url('store/order_index')}"
            },
            jumpStoreInfo(){
                window.location.href = "{:url('store/info_index')}"
            },
            jumpForum(){
                window.location.href = "{:url('user/forum_index')}"
            },
        },
    })
</script>
</body>
</html>
